﻿Public Class frmmain
    Dim _mysql As New ClsSQLhelper
    Dim Strsql As String
    Private Sub frmmain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If MsgBox("คุณต้องการออกจากโปรแกรมหรือไม่ ?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "ยืนยันการออกจากโปรแกรม") = MsgBoxResult.No Then
            e.Cancel = True
        End If
    End Sub

    Private Sub frmmain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Strsql = "select office_imagesharingpart from office"
        My.Settings.ImgSharePart = _mysql.MySQLExecuteScalar(Strsql)


    End Sub

    Private Sub BtnItem_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnItem.ItemClick
        With frmOnHand
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()

        End With
    End Sub

    Private Sub BtnExit_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnExit.ItemClick

    End Sub
    Private Sub Mn_RptOnHandReport_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles Mn_RptOnHandReport.ItemClick

        With frmonhandreport
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()

        End With
    End Sub

    Private Sub BtnClose_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnClose.ItemClick
        If MsgBox("คุณต้องการออกจากโปรแกรมหรือไม่ ?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "ยืนยันการออกจากโปรแกรม") = MsgBoxResult.No Then Exit Sub
        Me.Dispose()
    End Sub

    Private Sub BtnDepartment_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnDepartment.ItemClick
        With frmDepartments
            .MdiParent = Me
            '.WindowState = FormWindowState.Maximized

            .Show()
        End With
    End Sub

    Private Sub BarButtonItem1_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnKind.ItemClick
        With frmSection
            .MdiParent = Me
            .Show()
        End With
    End Sub

    Private Sub BtnType_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnType.ItemClick
        With frmType
            .MdiParent = Me
            .Show()
        End With
    End Sub

    Private Sub RibbonControl1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RibbonControl1.Click
        With RibbonControl1

        End With
    End Sub

    Private Sub MnInvReport54_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles MnInvReport54.ItemClick

        With frmInvReport54
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()
        End With
    End Sub


    Private Sub MnDBSetting_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles MnDBSetting.ItemClick

        With frmDBSetting
            .MdiParent = Me
            .StartPosition = FormStartPosition.CenterScreen
            .Show()
        End With
    End Sub

    Private Sub BarButtonItem1_ItemClick_1(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
        AboutBox1.ShowDialog()
    End Sub

    Private Sub MnItem_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles MnItem.ItemClick
        With frmOnHand
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()

        End With
    End Sub

    Private Sub MnDep_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles MnDep.ItemClick
        With frmDepartments
            .MdiParent = Me
            '.WindowState = FormWindowState.Maximized

            .Show()
        End With
    End Sub

    Private Sub MnSection_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles MnSection.ItemClick
        With frmSection
            .MdiParent = Me
            .Show()
        End With
    End Sub

    Private Sub MnType_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles MnType.ItemClick
        With frmType
            .MdiParent = Me
            .Show()
        End With
    End Sub

    Private Sub BtnNewItem_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnNewItem.ItemClick
        frmNewItem.ShowDialog()
    End Sub

    Private Sub BtnDischarge_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs)

        With frmDischargeList
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()
        End With

    End Sub

    Private Sub MnDischargelist_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles MnDischargelist.ItemClick

        With frmDischargeList
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()
        End With
    End Sub

    Private Sub BtnStandardCode_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnStandardCode.ItemClick

        With frmstandardcode
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()
        End With
    End Sub

    Private Sub BtnTypes_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnTypes.ItemClick
        With frmCategories
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()
        End With

    End Sub

    Private Sub BtnAttribute_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnAttribute.ItemClick
        With frmAttribute
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()
        End With

        
    End Sub

    Private Sub BtnWaitDischarge_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnWaitDischarge.ItemClick
        With frmWaitDischargeItems
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()
        End With
    End Sub

    Private Sub BtnDischargeItem_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnDischargeItem.ItemClick
        With frmDischargeList
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()
        End With
    End Sub

    Private Sub BtnWaitCode_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BtnWaitCode.ItemClick
        With frmWaitCodeItems
            .MdiParent = Me
            .WindowState = FormWindowState.Maximized
            .Show()
        End With
    End Sub
End Class
